import 'package:flutter/material.dart';
import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart';

class HomeSwiper extends StatefulWidget {
  List swiperlist;
  HomeSwiper({Key? key, required List this.swiperlist}) : super(key: key);

  @override
  _HomeSwiperState createState() => _HomeSwiperState();
}

class _HomeSwiperState extends State<HomeSwiper> {
  @override
  Widget build(BuildContext context) {
    return Swiper(
      itemBuilder: (BuildContext context, int index) {
        return Image.network(
          widget.swiperlist[index]['img']
        );
      }, 
      autoplay: true,
      autoplayDelay: 3000,
      pagination: const SwiperPagination(),
      itemCount: widget.swiperlist.length
    );
  }
}